package com.example.film.mapper;

import com.example.film.entity.TheaterWeekSell;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TheaterWeekSellMapper {

    //查看院线每周票房信息
    @Select("select theaterName,session,people,box_office,week from theaterweeksell")
    List<TheaterWeekSell> findTheaterWeekSell();

    //分页查询院线每周票房信息
    @Select("select theaterName,session,people,box_office,week from theaterweeksell LIMIT #{pageSize} OFFSET #{startIndex}")
    List<TheaterWeekSell> findTheaterWeekSellInfo(@Param("startIndex") Integer startIndex, @Param("pageSize") Integer pageSize);

    //根据周数查询院线每周票房信息
    @Select("select theaterName,session,people,box_office,week from theaterweeksell where week=#{week}")
    List<TheaterWeekSell> findTheaterWeekSellByWeek(Integer week);
}
